import { useUserStore } from './user'
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useActivityStore = defineStore(
  'activity-store',
  () => {
    const userStore = useUserStore()
    const activityShow = ref<any>()
    const getActivityId = computed(() => activityShow.value?.id)
    const getActivityShow = computed(() => activityShow.value)
    const getIsHotelBooking = computed(() => {
      if (userStore.userInfo.case) return true
      return activityShow.value?.vipPackagesInfo.isHotelBooking
    })
    const changeActiveShow = (
      data: any& {
        qrcode: string
      }
    ) => {
      activityShow.value = data
      console.log(activityShow.value)
    }
    return {
      activityShow,
      getActivityId,
      getActivityShow,
      getIsHotelBooking,
      changeActiveShow,
    }
  },
  {
    persist: true,
  }
)
